function Security() {
	
	var secur = this;
	
	this.load = function(callback1, callback2) {
        var d = document.createElement('div');
        
        var form = '<table>\n\
                <tr>\n\
                <td align="right">Username:</td>\n\
                    <td><input type="text" id="j_username" /></td>\n\
                </tr>\n\
                <tr>\n\
                    <td align="right">Password:</td>\n\
                    <td><input type="password" id="j_password" /></td>\n\
                </tr>\n\
                <tr>\n\
                    <td align="right">Remember?</td>\n\
                    <td><input type="checkbox" id="_spring_security_remember_me" /></td>\n\
                </tr>\n\
            </table>\n\
            ';
        
    	$(d).html(form);
        $(d).dialog("option", "title", "Security page");
        $(d).dialog('open');
        
        $(d).dialog({
            width : '750px',
            position:['middle',20],
            modal : true,
            resizable : false,
            close : function() {
                $(d).remove();
            },
            buttons : {
                "Cancel" : function() {
                    $(d).dialog('destroy');
                    $(d).remove();
                },
                "Save" : function() {
                    var form_data = {
                        email: $("#j_username").val(),
                        password: $("#j_password").val(),
                        remember_me: $("#_spring_security_remember_me").is(':checked')
                    };
                    $.ajax({
                        type : "POST",
                        url : "login.htm",
                        data : form_data,
                        dataType : "json",
                        success : function(response) {
                            if (response.res == "false") {
                                alert(response.error);
                                return;
                            }
                            
                            alert("Success!");
                            callback2(response, callback1);
                            $(d).dialog('destroy');
                            $(d).remove();
                        }
                    })
                }
            }
        });
        return d;
	}
}